<template>
  <div>
    <!-- 给form表单绑定提交事件，并组织默认提交 -->
     <form @submit.prevent="login">
        <input type="text" name="username" v-model="form.username">

        <input type="text" name="password" v-model ="form.password ">

        <button>提交</button>
    </form>
   </div>
</template>
 
<script>
export default {
  data() {
    return {
         msg:'杭州的第一场雪,让六哥鸡冻不已',

        form:{
            username:'',
            password:''
        }
    };
  },
  methods: {
    login () {
        console.log(this.msg);
        console.log(this.form.username);
        console.log(this.form.password);
        
    }
  }
};
</script>

<style scoped>
     
</style>